import Vue from 'vue'
import App from './App.vue'
//引入router包
import vueRouter from "vue-router";
//注册
Vue.use(vueRouter)
//配置规则数组
const routes = [
	{
		path: "/",
		redirect: "/my",
	},
	{
		path: "/find",
		component: Find
	},
	{
		path: "/my",
		component: My
	},
	{
		path: "/part",
		component: Part
	},
	{
		path: "/part/:username",
		component: Part
	},
	{
		path: "*",
		component: Fous
	}
]
// 导入路由对应组件
import Find from '@/views/Find' // vue文件中，@表示 src目录的绝对路径
import My from '@/views/My'
import Part from '@/views/Part'
import Fous from '@/views/Fous'
//生成路由对象
const router = new vueRouter({
	// routes:routes
	routes,
	mode: "history"
})
Vue.config.productionTip = false

new Vue({
	router,
	render: (h) => h(App),
}).$mount('#app')
